import { ProductTypeFieldNameMappingEnum } from "@model/enum/FieldMappingEnum"
import { QualityRuleTimeTypeEnum } from "@model/enum/QualityRuleEnum"

interface QualityRuleOriginal {
  // 质保起算时间
  qualityStartDate: string
  // 质保时长
  qualityDuration: number | null
  // 质保时长 (月/年)
  qualityUnit: string

  qualityFiledName?: string | null
}

interface QualityRuleQualityTime {
  // 质保时长
  qualityTimeNumber: number | string,
  // 质保时长 (月/年)
  qualityTimeType: string | QualityRuleTimeTypeEnum
}

interface QualityRuleForm {
  // 质保起算时间
  [ProductTypeFieldNameMappingEnum.QualityStartTime]: string
  // 质保时长
  [ProductTypeFieldNameMappingEnum.QualityTime]: QualityRuleQualityTime

  [ProductTypeFieldNameMappingEnum.QualityFiledName]?: string | null

}

interface QualityRuleSearchFrom {
  // 自定义质保起算时间
  qualityStartDate: string[]
  // 关联产品质保起算时间
  qualityFiledName?: string[]
  // 质保时长
  qualityDuration: number | null
  // 质保时长 (月/年)
  qualityUnit: string
}

export {
  QualityRuleOriginal,
  QualityRuleQualityTime,
  QualityRuleForm,
  QualityRuleSearchFrom
}